package com.kady.service;

import com.kady.entity.*;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: kady
 * \* Date: 2021/3/30
 * \* Time: 13:05
 * \* 千峰JAVA2101班
 * \* Description: 前端接口业务层
 * \
 */
public interface FrontService {

    List<Table> getTableListByStatus() throws SQLException;

    PageInfo getFoodListByCondition(String keyword, PageInfo pageInfo, String typeId) throws SQLException, InvocationTargetException, IllegalAccessException;

    List<FoodType> getFoodTypeList() throws SQLException;

    Food getFoodDetail(String foodId) throws SQLException;

    CartItem getCartItem(String foodId, User user) throws SQLException;

    double calCartTotalPrice(List<CartItem> cartItems);

    long calCartTotalCount(List<CartItem> cartItems);

    Cart updateCart(Cart cart,String foodId, User user, long count, boolean isCreate) throws SQLException;

    void setOrder(String orderId,User user, String tableId, Cart cart);

    long settleOrder(String orderId) throws SQLException;

    Order findUserHasNotOrdered(Object user) throws SQLException;

    Cart getOrderCart(String orderId, User user) throws SQLException, InvocationTargetException, IllegalAccessException;
}
